﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CF_DAL_WS.Models;

namespace CF_DAL_WS.DTO
{
    public class InformationWebDTO
    {
        public int ID { get; set; }
        public string Email { get; set; }
        public string PassEmail { get; set; }
        public string Address { get; set; }

        public static InformationWebDTO Translate(InformationWeb Entity)
        {
            if (Entity != null)
            {
                var dto = new InformationWebDTO
                {
                    ID = Entity.ID,
                    Email = Entity.Email,
                    PassEmail = Entity.PassEmail,
                    Address = Entity.Address
                };
                return dto;
            }
            return null;
        }

        public static InformationWeb Reverse(InformationWebDTO obj)
        {
            var entity = new InformationWeb
            {
                Email = obj.Email,
                PassEmail = obj.PassEmail,
                Address = obj.Address
            };
            return entity;
        }

        public void UpdateEntity(ref InformationWeb entity)
        {
            entity.Email = Email;
            entity.PassEmail = PassEmail;
            entity.Address = Address;
        }
    }
}